package com.foredu.fiqs.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.foredu.fiqs.domain.Salary;
import com.foredu.fiqs.persist.ISalaryDao;
import com.foredu.fiqs.service.ISalaryQueryService;

@Transactional
public class SalaryQueryService implements ISalaryQueryService {
	
	private ISalaryDao salaryDao = null;
	
	public ISalaryDao getSalaryDao() {
		return salaryDao;
	}

	public void setSalaryDao(ISalaryDao salaryDao) {
		this.salaryDao = salaryDao;
	}

	@Override
	public Salary findSalaryByUserIdAndDate(int userId, int month, int year) {
		Salary salary = salaryDao.findSalaryByUserIdAndDate(userId, month, year);
		return salary;
	}

	@Override
	public List<Map<String, Object>> findSalItemBySalaryId(int salaryId) {
		List<Map<String, Object>> itemList = salaryDao.findSalItemBySalaryId(salaryId);
		return itemList;
	}

	@Override
	public List<Map<String, Object>> findSalDetailBySalItemId(int salItemId) {
		List<Map<String, Object>> detailList = salaryDao.findSalDetailBySalItemId(salItemId);
		return detailList;
	}

}
